<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <link href="../../themes/css/ui.common.css" rel="stylesheet" type="text/css" />
    <link href="../../themes/css/ui.child.css" rel="stylesheet" type="text/css" />
    <link href="../../style/jquery_ui/jquery-ui-1.8.custom.css" rel="stylesheet" type="text/css" />
    <link id="skin_css" rel="stylesheet" type="text/css" href="../../themes/css/ui.c.blue.css" />
    <link href="../../style/mailSender.css" rel="stylesheet" type="text/css" />
    <link href="../../themes/css/ui.selector.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.json-2.2.min.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script>
    <script src="../../Scripts/mailSender.js" type="text/javascript"> </script>
    <script src="../../Scripts/ui.default.js " type="text/javascript" charset="UTF-8"></script>
    <script src="../../Scripts/ui.admincp.js" type="text/javascript" charset="UTF-8"></script>
    <style type="text/css">
        .ui-state-default, .text-close-icon, .lm_ca, .groupclose
        {
            cursor: hand;
        }
        .ui-state-default
        {
            height: 32px;
        }
    </style>
    <script type="text/javascript" src="../../Scripts/ui.dialogFormHelper.js"></script>
    <script type="text/javascript">
        $(function () {

            $("#dialog").dialog("destroy");
            $("#dialog-form").dialog({
                autoOpen: false,
                height: 530,
                width: 757,
                modal: true,

                close: function () {
                    //allFields.val('').removeClass('ui-state-error');
                }
            });

            $('#addGoodsButton').click(function () {
                $("#dialog-form").dialog({ 'title': "��� ����ƻ�" });
                $('#dialog-form').dialog('open');
            });
            registeTabToggle("#addGoodsCategoryButton", "#cancelAddGoodsCategoryButton");
            //ע�Ṧ�ܰ�ť�¼�..
            registeRowFuncButton();

        });

        function toEditHandler(e) {
            var columns = e.data;

            $("#dialog-form").dialog({ 'title': "�༭ �ƻ���Ϣ" });
            $("#txt_planOrders").val($(columns[1]).text());
            alert($(columns[2]).text());
            $("#drl_planType").val($(columns[2]).text());
            $("#txt_postId").val($(columns[3]).text());

            $("#goodsId").val(e.entityId);
            $('#dialog-form').dialog('open');

        }
    </script>
    <script type="text/javascript">
        $(function () {
            $(".ui-state-default ").live("mouseover", function () {
                $(this).find(".text-close-icon").attr("src", "../../themes/icons/close-red.png");
            }).live("mouseout", function () {
                $(this).find(".text-close-icon").attr("src", "../../themes/icons/close-gray.png");
            });

            $(".text-close-icon").live("click", function () {
                var _id = $(this).parent().attr("sectionId");
                var name = $(this).parent().text();
                $(this).parent().remove();
                $("#groupOne").append(buildSubGroup({ sectionId: _id, staffName: name }));
                countReceiverReduce();
            });

            $("#sortable").sortable({
                placeholder: 'ui-state-highlight'
            });
            $("#sortable").disableSelection();
            getAllSelected();
        });

        function getAllSelected() {

            $("#btnCloseSelector").click(function () {

                var checkPlanIds = "";

                $(".text-display").each(function (i) {
                    checkPlanIds += $(this).attr("sectionId") + ",";
                });

                alert(checkPlanIds.substring(0, checkPlanIds.length - 1));
            });
        }

        function buildSubGroup(item) {

            var result = '<div class="groupItem"><a class="lm_addr" key="g1" href="javascript:void(0)">' +
            '<div class="arguementBar" key="g1" csid="' + item.sectionId + '" itemindex="0" title="">'
        + item.staffName + ' <span class="details Tips3"> </span></div></a></div>';

            return result;
        }
        function moveItemHandler(e) {

            var sectionId = $(e).find(".arguementBar").attr("csid");
            var sectionName = $(e).text();
            $("#sortable").append("<li class=\"ui-state-default text-display\" style='text-align:right;' sectionId=\"" + sectionId + "\">" + "<span style='float:left;'>"
          + sectionName + "</span>" + '<img alt="Remove" src="../../themes/icons/close-gray.png" class="text-close-icon" height="10px" width="10px" title="�Ƴ�" />'
+ "</li>");
        }
    </script>
</head>
<body>
    <div class="PageChild_Where">
        <table style="height: 60px;" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td class="mtd" valign="top">
                    �������:
                </td>
                <td>
                    <input name="txt_Tile" type="text" maxlength="100" id="add" style="width: 200px;" />
                    <div class="Tips3">
                        ������������ƹ���,���ؼ����÷ֺ����..
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;&nbsp;
                </td>
                <td>
                    <input type="submit" name="btn_Serach" value="����" id="btn_Serach" />
                    &nbsp;&nbsp; <span id="lbl_list_count">������ <b>9</b> ��������ļ�¼��</span>
                    <input type="button" id="addGoodsButton" class="ui-button" value="���������ƻ�" />
                </td>
            </tr>
        </table>
    </div>
    <div class="PageChild_List">
        <table width="100%" border="0" cellspacing="0" style="text-align: left">
            <tbody class="PageChild_List_head">
                <tr>
                    <td width="16">
                        <img src="../themes/images/default/icons/pcde_314.png" width="16" height="16" />
                    </td>
                    <td>
                        ����ƻ�����
                    </td>
                    <td>
                        ��������
                    </td>
                    <td>
                        ְλ���
                    </td>
                    <td>
                        ״̬
                    </td>
                    <td class="td_width40">
                        �༭
                    </td>
                    <td class="td_width40">
                        ɾ��
                    </td>
                </tr>
            </tbody>
            <tbody class="PageChild_List_main" style="text-align: left">
                <s:iterator value="list" var="item">
						<!-- ���������б?ʼ -->
						<tr class='td_no_bord'>
							<td class="td_width25">
								<span title="24"><input id="Chk_Num" type="checkbox"
										name="ReptShow$ctl01$Chk_Num" /> </span>
							</td>
						
							<td>
								<span>
									${item.planOrders}</span>&nbsp;
							</td>
							<td>
								<span>${item.checkPlanCategory.categoryName} </span>&nbsp;
							</td>
							<td>
								<span> ${item.postInfo.postId} </span>&nbsp;
							</td>
							<td>
								<span>
									${item.states} </span>&nbsp;
							</td>
							
							<td>
								<a class="ui-link-edit-button" id="sender_${item.goodId}"
									href="javascript:void(0);" state="0" entityId="${item.goodId}">
									<img src="../../themes/icons/edit.png" title="���б༭" /> </a> &nbsp;

							</td>
							<td>
								<a href="javascript:;"
									onclick='location="infolist!delete.action?delete_id=${item.goodId}";'><img
										src="../../themes/icons/delete.png" /> </a>
							</td>
						</tr>
					</s:iterator>
                <!-- �����б���� -->
            </tbody>
        </table>
    </div>
    <!--��ҳ������ʼ-->
    <div id="divTopPageNavi" class="list_r_title_text3">
        <s:if test="currpage<=1">
				<span class='list_r_title_text3a'> <img
						src="<%=request.getContextPath()%>/themes/images/default/page_up_gray.gif"></img>
				</span>

			</s:if>
        <s:else>
				<span class='list_r_title_text3a'> <a name="link_page_prev"
					id="link_page_prev" href="javascript:void(0);"
					currentPage="${currpage-1}"> <img
							src="<%=request.getContextPath()%>/themes/images/default/page_up.gif"></img>
				</a> </span>
			</s:else>
        <span class='list_r_title_text3b'>��${currpage }ҳ/��${totalpage }ҳ </span>
        <s:if test="currpage>=totalpage">
				<span class='list_r_title_text3a'> <img
						src="<%=request.getContextPath()%>/themes/images/default/page_down_gray.gif"></img>
				</span>
			</s:if>
        <s:else>
				<span class='list_r_title_text3a'> <a name="link_page_next"
					id="link_page_next" href="javascript:void(0);"
					currentPage="${currpage+1 }"> <img
							src="<%=request.getContextPath()%>/themes/images/default/page_down.gif"></img>
				</a> </span>
			</s:else>
        <span id="goToPageTextArea">
            <input type="text" class="easyui-numberbox" id="goPageNum" max="${totalpage}" min="1" />
            <input type="button" id="turnToPageButton" value="GO" /></span>
    </div>
    <!--��ҳ��������-->
</body>
<!-- ������ǩ -->
<div id="dialog-form" style="display: none;" title="���������ƻ�">
    <div class="ui-mainTab">
        <div>
            <input type="text" id="planId" class="hiddenObject" />
            <table width="100%" class="tb tb2">
                <tbody>
                    <tr>
                        <td class="mtd">
                            ��������:
                        </td>
                        <td>
                            <select id="drl_planType" class="control">
                            </select>
                            <input type="button" id="addGoodsCategoryButton" value="���">
                        </td>
                        <td width="20">
                        </td>
                    </tr>
                </tbody>
                <tr>
                    <td class="mtd">
                        ��������:
                    </td>
                    <td>
                        <input class="control hiddenObject" value="" id="txt_planOrders">
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td valign="top">
                                    <span>ѡ����:</span>
                                    <div class="Box" id="add_address_Left" style="overflow-y: auto; height: 320px; width: ">
                                        <div class="lm_sbar hiddenObject">
                                            <input type="button" class="lm_sopen" style="" id="btn_UserSearch" />
                                            <div>
                                                <input type="text" id="txt_SearchText" style="height: 19px;" value="������Ա..." class="txt" />
                                            </div>
                                        </div>
                                        <div id="lb_SearchTips" style="display: none">
                                            ���ҵ����½��:
                                            <div id="lm_ifNullTips">
                                            </div>
                                        </div>
                                        <div class="lm_panel hiddenObject" id="lm_SB" style="">
                                        </div>
                                        <div class="lm_panel" id="lm_ListB">
                                            <div class="groupclose" key="g1" entityid="1" open="false" hasload="false" style="font-weight: bolder;">
                                                <div style="padding: 2px 0pt 1px; background: none repeat scroll 0% 0% rgb(255, 255, 255);
                                                    color: black;" onmouseout="this.style.background='#fff'" onmouseover="this.style.background='#ffeec2'"
                                                    class="">
                                                    <span class="Tips3"></span>
                                                    <div class="lm_ca" title="�����б�">
                                                        <input type="button" class="lm_ico" />
                                                        �����б�<span class="Tips3" id="groupTips_1">(δ����)</span>
                                                    </div>
                                                </div>
                                            </div>
                                            <div id="groupOne" class="groupsub" key="g1">
                                            </div>
                                        </div>
                                    </div>
                                </td>
                                <td align="center" style="padding: 5px;">
                                    <img alt="" src="../../style/arrow_left.gif" />
                                </td>
                                <td valign="top">
                                    <span>��ѡ��(<span id="count_Receiver">0</span>)</span>
                                    <div id="add_address" style="overflow-y: auto; height: 320px; padding-left: 3px;"
                                        class="Box">
                                        <ul id="sortable">
                                        </ul>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td>
                    </td>
                </tr>
                <tr>
                    <td class="mtd">
                        ְλ��ţ�
                    </td>
                    <td>
                        <input class="control" value="" id="txt_postId">
                    </td>
                    <td>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        <div>
                            <input type="button" id="btnCloseSelector" value="�ύ" class="o-btn">
                            &nbsp;&nbsp;
                            <input type="button" name="name" id="cancelAddGoodsInfoButton" class="dialogFormCloseButton o-btn"
                                dialogform="#dialog-form" value="ȡ��" />
                        </div>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <!-- �������� -->
    <div id="addGoodsCategoryTab" title="���" class="ui-assistantTab" style="display: none;">
        <table width="100%" class="tb tb2">
            <tbody>
                <tr>
                    <td class="mtd">
                        �������:
                    </td>
                    <td>
                        <input class="control" type="text" name="name" value="" />
                    </td>
                    <td width="20">
                    </td>
                </tr>
            </tbody>
            <tr>
                <td class="mtd">
                    &nbsp;
                </td>
                <td>
                    <input type="button" name="name" value="���" />
                    <input type="button" name="name" id="cancelAddGoodsCategoryButton" value="ȡ��" />
                </td>
                <td>
                </td>
            </tr>
        </table>
    </div>
</div>
</html>
